<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>添加商品类型</title>
	<script type='text/javascript' src='http://localhost/dshop/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/dshop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/dshop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/dshop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/dshop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/dshop';
		WEB = 'http://localhost/dshop/index.php';
		URL = 'http://localhost/dshop/index.php?a=Admin&c=Category&m=edit&cid=8';
		HDPHP = 'http://localhost/dshop/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/dshop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/dshop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/dshop/hdphp/hdphp/Extend';
		APP = 'http://localhost/dshop/index.php?a=Admin';
		CONTROL = 'http://localhost/dshop/index.php?a=Admin&c=Category';
		METH = 'http://localhost/dshop/index.php?a=Admin&c=Category&m=edit';
		GROUP = 'http://localhost/dshop/hd';
		TPL = 'http://localhost/dshop/hd/Tshop/Admin/Tpl';
		CONTROLTPL = 'http://localhost/dshop/hd/Tshop/Admin/Tpl/Category';
		STATIC = 'http://localhost/dshop/Static';
		PUBLIC = 'http://localhost/dshop/hd/Tshop/Admin/Tpl/Public';
		HISTORY = 'http://localhost/dshop/index.php?a=Admin&c=Category&m=index';
		HTTPREFERER = 'http://localhost/dshop/index.php?a=Admin&c=Category&m=index';
</script>
</head>
<body>
	<form method="post" class="hd-form">
		<input type="hidden" name="cid" value="<?php echo $field['cid'];?>">
	<div class="wrap">
				<div class="menu_list">
					<ul>
						<li>
							<a href="<?php echo U('index');?>">
								商品栏目
							</a>
						</li>
						<li>
							<a href="javascript:;" class="action">
								添加栏目
							</a>
						</li>
						<li>
							<a href="javascript:hd_ajax('<?php echo U(updateCache);?>')">
								更新缓存
							</a>
						</li>
					</ul>
				</div>
				<div class="title-header">添加商品类型</div>
				<table class="table1">
					<tr>
						<th class="w150">栏目名称</th>
						<td>
							<input type="text" name="cname" class="w300" value="<?php echo $field['cname'];?>">
						</td>
					</tr>
					<tr>
						<th class="w150">上级</th>
						<td>
							<select name="pid" >
								<option value="0">顶级</option>
								<?php $hd["list"]["cat"]["total"]=0;if(isset($category) && !empty($category)):$_id_cat=0;$_index_cat=0;$lastcat=min(1000,count($category));
$hd["list"]["cat"]["first"]=true;
$hd["list"]["cat"]["last"]=false;
$_total_cat=ceil($lastcat/1);$hd["list"]["cat"]["total"]=$_total_cat;
$_data_cat = array_slice($category,0,$lastcat);
if(count($_data_cat)==0):echo "";
else:
foreach($_data_cat as $key=>$cat):
if(($_id_cat)%1==0):$_id_cat++;else:$_id_cat++;continue;endif;
$hd["list"]["cat"]["index"]=++$_index_cat;
if($_index_cat>=$_total_cat):$hd["list"]["cat"]["last"]=true;endif;?>

									<option value="<?php echo $cat['cid'];?>" <?php echo $cat['disabled'];?> <?php echo $cat['selected'];?>><?php echo $cat['_name'];?></option>
								<?php $hd["list"]["cat"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?> 
							</select>
						</td>
					</tr>
					<tr>
						<th class="w150">关键字</th>
						<td>
							<input type="text" name="keywords" class="w300" value="<?php echo $field['keywords'];?>">
						</td>
					</tr>
					<tr>
						<th class="w150">描述</th>
						<td>
							<textarea name="description" class="w400 h100"><?php echo $field['description'];?></textarea>
						</td>
					</tr>
					<tr>
						<th>栏目类型</th>
						<td>
							<label><input type="radio" name="cattype" value="1" <?php if($field['cattype'] == 1){?>checked=""<?php }?>> 普通栏目 </label>
							<label><input type="radio" name="cattype" value="2" <?php if($field['cattype'] == 2){?>checked=""<?php }?>> 封面 </label>
						</td>
					</tr>
					<tr>
						<th class="w150">单位</th>
						<td>
							<input type="text" name="unit" class="w300" value="<?php echo $field['unit'];?>">
						</td>
					</tr>
					<tr>
						<th class="w150">价格区间</th>
						<td>
							<input type="text" name="pricerange" class="w300" value="<?php echo $field['pricerange'];?>">
						</td>
					</tr>
				</table>
				<div class='position-bottom'>
					<input type="submit" value="确定" class='hd-success'>
				</div>
		</div>
		</form>
</body>
</html>